<?php
/* @var $this MainLedgerController */
/* @var $model MainLedger */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'main-ledger-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'ledger_no'); ?>
		<?php echo $form->textField($model,'ledger_no'); ?>
		<?php echo $form->error($model,'ledger_no'); ?>
	</div>

	<div class="row">
	<?php echo $form->labelEx($model,'soldier_id'); ?>
	<?php echo $form->dropDownList($model, 'soldier_id', CHtml::listData(
	Soldier::model()->findAll(), 'id', 'serial_no','soldier_l_name'),
	array('prompt' => 'Select a soldier serial no')
	); ?>
	<?php echo $form->error($model,'soldier_id'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'ledger_date');$form->labelEx($model,'ledger_date'); ?>
		<?php echo CHtml::activeTextField($model,'ledger_date',array("id"=>"d_date"));$form->textField($model,'ledger_date'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"d_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'d_date',
        'button'=>'d_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
		<?php echo $form->error($model,'ledger_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'credit'); ?>
		<?php echo $form->textField($model,'credit'); ?>
		<?php echo $form->error($model,'credit'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'credit_date');$form->labelEx($model,'credit_date'); ?>
		<?php echo CHtml::activeTextField($model,'credit_date',array("id"=>"z_date"));$form->textField($model,'credit_date'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"z_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'z_date',
        'button'=>'z_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
	<?php echo $form->error($model,'credit_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'debit'); ?>
		<?php echo $form->textField($model,'debit'); ?>
		<?php echo $form->error($model,'debit'); ?>
	</div>

		<div class="row">
		<?php echo CHtml::activeLabelEx($model,'debit_date');$form->labelEx($model,'debit_date'); ?>
		<?php echo CHtml::activeTextField($model,'debit_date',array("id"=>"y_date"));$form->textField($model,'debit_date'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"y_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'y_date',
        'button'=>'y_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
	<?php echo $form->error($model,'debit_date'); ?>
	</div>
	
	
	<div class="row">
		<?php echo $form->labelEx($model,'official_receipt_no'); ?>
		<?php echo $form->textField($model,'official_receipt_no',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'official_receipt_no'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'date_of_occupancy');$form->labelEx($model,'date_of_occupancy'); ?>
		<?php echo CHtml::activeTextField($model,'date_of_occupancy',array("id"=>"e_date"));$form->textField($model,'date_of_occupancy'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"e_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'e_date',
        'button'=>'e_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
		<?php echo $form->error($model,'date_of_occupancy'); ?>
	</div>
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'date_of_vacated');$form->labelEx($model,'date_of_vacated'); ?>
		<?php echo CHtml::activeTextField($model,'date_of_vacated',array("id"=>"f_date"));$form->textField($model,'date_of_vacated'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"f_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'f_date',
        'button'=>'f_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
		<?php echo $form->error($model,'date_of_vacated'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'date_of_retirement');$form->labelEx($model,'date_of_retirement'); ?>
		<?php echo CHtml::activeTextField($model,'date_of_retirement',array("id"=>"g_date"));$form->textField($model,'date_of_retirement'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"g_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'g_date',
        'button'=>'g_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
		<?php echo $form->error($model,'date_of_retirement'); ?>
	</div>
	
	
	<div class="row">
		<?php echo $form->labelEx($model,'monthly_rental'); ?>
		<?php echo $form->textField($model,'monthly_rental',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'monthly_rental'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ledger_update'); ?>
		<?php echo $form->textArea($model,'ledger_update',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'ledger_update'); ?>
	</div>

		<div class="row">
		<?php echo CHtml::activeLabelEx($model,'ledger_update_date');$form->labelEx($model,'ledger_update_date'); ?>
		<?php echo CHtml::activeTextField($model,'ledger_update_date',array("id"=>"a_date"));$form->textField($model,'ledger_update_date'); ?>
		<?php echo CHtml::image("images/cal.jpg","calendar",
		array("id"=>"a_button","class"=>"pointer")); ?>
		&nbsp;(Click this)
		<?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'a_date',
        'button'=>'a_button',
        'ifFormat'=>'%Y-%m-%d',
    ));
    ?>
		<?php echo $form->error($model,'ledger_update_date'); ?>
	</div>
	

	<div class="row">
		<?php echo $form->labelEx($model,'quarters_id'); ?>
		<?php echo $form->dropDownList($model, 'quarters_id', CHtml::listData(
		Quarters::model()->findAll(), 'id', 'quarters_name','quarters_adddress'),
		array('prompt' => 'Select a quarter')
		);$form->textField($model,'quarters_id'); ?>
		<?php echo $form->error($model,'quarters_id'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'employee_id'); ?>
		<?php echo $form->textField($model,'employee_id'); ?>
		<?php echo $form->error($model,'employee_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'employee_id');$form->labelEx($model,'soldier_id'); ?>
		<?php echo $form->dropDownList($model, 'employee_id', CHtml::listData(
			Employee::model()->findAll(), 'id', 'employee_name','employee_id'),
			array('prompt' => 'Select an Employee')
			);$form->textField($model,'soldier_id'); ?>
		<?php echo $form->error($model,'employee_id');$form->error($model,'soldier_id'); ?>
	</div>

	<?php if(!is_null($model->id)) : ?>
	<div class="row">
		<?php echo $form->labelEx($model,'Status'); ?>
		<?php echo $form->dropDownList($model,'Status',array('Active'=>'Active','Pending'=>'Pending'),array('empty'=>'Select status')); ?>
		<?php echo $form->error($model,'Status'); ?>
	</div>
<?php endif; ?>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->